package com;

import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

public class Collection_17_SortedMap_03 {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Set set = new TreeSet(new Comparator() {

			@Override
			public int compare(Object o1, Object o2) {
				int a = ((Integer) o1);
				int b = ((Integer) o2);
				return b - a;
			}
		});
		set.add(1);
		set.add(5);
		set.add(3);
		set.add(2);

		System.out.println(set);
	}

}
